Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(types): add missing shared types #3212

Merged
merged 19 commits into from
Nov 13, 2024
Merged

fix(types): add missing shared types #3212

merged 19 commits into from
Nov 13, 2024

Conversation

userquin
Copy link
Collaborator

@userquin userquin commented Nov 9, 2024

πŸ”— Linked issue

resolves #3201

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

Nuxt module builder generating module types in types dts (node and some runtime hooks types), we use it in the default package export, but internal types created in module dts, this PR just adds a new subpackage export ./types using module.d.mts with the types only and also including the subpackage inside typesVersions to include node10 consumers.
This PR includes:

  • add src/types.ts to the build config file to add shared types to the types dts
  • refactor CI workflow to build after stubbing to fix lint script
  • run build script after stubbing before running tests (to fix typecheck: tsc --noEmit)

This PR also changes the default subpackage export to use default instead import (ESM only).

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have added tests (if possible).
  • I have updated the documentation accordingly.

Copy link

pkg-pr-new bot commented Nov 9, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/@nuxtjs/i18n@3212

commit: f568b91

@userquin
Copy link
Collaborator Author

userquin commented Nov 9, 2024

@userquin userquin changed the title fix(types): add types to subpackage exports using module dts fix(types): add missing shared types Nov 10, 2024
@userquin
Copy link
Collaborator Author

SB reproduction updated to use relative paths in nuxt config file (we cannot use nuxt aliases): registering also i18n.options.ts using relative path

@BobbieGoede
Copy link
Collaborator

If we're also running build do we still need to run dev:prepare before it? Doesn't build overwrite the output of dev:prepare πŸ€”?

@userquin
Copy link
Collaborator Author

userquin commented Nov 13, 2024

If we're also running build do we still need to run dev:prepare before it? Doesn't build overwrite the output of dev:prepare πŸ€”?

πŸ˜… I'll check replacing the scripts , the problem is about the build script, should run also the prepare and it is not running it => create .nuxt stuff: if you check the starter you will see this "prepack": "nuxt-module-build prepare && nuxt-module-build build", (instead build script here)

@BobbieGoede BobbieGoede merged commit ff95738 into main Nov 13, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

LocaleObject type is no longer exported in v9
2 participants